<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>nmrglue.leastsqbound &mdash; nmrglue v0.1 documentation</title>
    <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.1',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="nmrglue v0.1 documentation" href="../index.html" />
    <link rel="up" title="Reference Guide" href="index.html" />
    <link rel="next" title="nmrglue.linesh" href="linesh.html" />
    <link rel="prev" title="nmrglue.helpers" href="helpers.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="linesh.html" title="nmrglue.linesh"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="helpers.html" title="nmrglue.helpers"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">nmrglue v0.1 documentation</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">Reference Guide</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#">nmrglue.leastsqbound</a><ul>
<li><a class="reference external" href="#low-level-functions">Low-Level Functions</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="helpers.html"
                                  title="previous chapter">nmrglue.helpers</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="linesh.html"
                                  title="next chapter">nmrglue.linesh</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/leastsqbound.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-nmrglue.analysis.leastsqbound">
<h1>nmrglue.leastsqbound<a class="headerlink" href="#module-nmrglue.analysis.leastsqbound" title="Permalink to this headline">¶</a></h1>
<p>Constrained multivariate Levenberg-Marquardt optimization</p>
<p>This module is imported as nmrglue.leastsqbound and can be called as such.</p>
<div class="section" id="low-level-functions">
<h2>Low-Level Functions<a class="headerlink" href="#low-level-functions" title="Permalink to this headline">¶</a></h2>
<p>These functions are typically not used directly by users. They are called by
high level functions.</p>
<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.leastsqbound">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">leastsqbound</tt><big>(</big><em>func</em>, <em>x0</em>, <em>bounds</em>, <em>args=()</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.leastsqbound" title="Permalink to this definition">¶</a></dt>
<dd><p>Constrained multivariant Levenberg-Marquard optimization</p>
<p>Minimize the sum of squares of a given function using the 
Levenberg-Marquard algorithm. Contraints on parameters are inforced using 
variable transformations as described in the MINUIT User&#8217;s Guide by
Fred James and Matthias Winkler.</p>
<p>Parameters:</p>
<ul>
<li><p class="first">func      functions to call for optimization.</p>
</li>
<li><p class="first">x0        Starting estimate for the minimization.</p>
</li>
<li><dl class="first docutils">
<dt>bounds    (min,max) pair for each element of x, defining the bounds on</dt>
<dd><p class="first last">that parameter.  Use None for one of min or max when there is
no bound in that direction.</p>
</dd>
</dl>
</li>
<li><p class="first">args      Any extra arguments to func are places in this tuple.</p>
</li>
</ul>
<p>Returns: (x,{cov_x,infodict,mesg},ier)</p>
<p>Return is described in the scipy.optimize.leastsq function.  x and con_v  
are corrected to take into account the parameter transformation, infodic 
is not corrected.</p>
<p>Additional keyword arguments are passed directly to the 
scipy.optimize.leastsq algorithm.</p>
</dd></dl>

<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.internal2external">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">internal2external</tt><big>(</big><em>xi</em>, <em>bounds</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.internal2external" title="Permalink to this definition">¶</a></dt>
<dd>Convert a series of internal variables to external variables</dd></dl>

<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.external2internal">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">external2internal</tt><big>(</big><em>xe</em>, <em>bounds</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.external2internal" title="Permalink to this definition">¶</a></dt>
<dd>Convert a series of external variables to internal variables</dd></dl>

<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.internal2external_grad">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">internal2external_grad</tt><big>(</big><em>xi</em>, <em>bounds</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.internal2external_grad" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the internal to external gradiant</p>
<p>Calculates the partial of external over internal</p>
</dd></dl>

<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.i2e_cov_x">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">i2e_cov_x</tt><big>(</big><em>xi</em>, <em>bounds</em>, <em>cov_x</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.i2e_cov_x" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.err">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">err</tt><big>(</big><em>p</em>, <em>bounds</em>, <em>efunc</em>, <em>args</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.err" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="nmrglue.analysis.leastsqbound.calc_cov_x">
<tt class="descclassname">nmrglue.analysis.leastsqbound.</tt><tt class="descname">calc_cov_x</tt><big>(</big><em>infodic</em>, <em>p</em><big>)</big><a class="headerlink" href="#nmrglue.analysis.leastsqbound.calc_cov_x" title="Permalink to this definition">¶</a></dt>
<dd>Calculate cov_x from fjac, ipvt and p as is done in leastsq</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="linesh.html" title="nmrglue.linesh"
             >next</a> |</li>
        <li class="right" >
          <a href="helpers.html" title="nmrglue.helpers"
             >previous</a> |</li>
        <li><a href="../index.html">nmrglue v0.1 documentation</a> &raquo;</li>
          <li><a href="index.html" >Reference Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2010, Jonathan J. Helmus.
      Last updated on Apr 04, 2011.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
    </div>
  </body>
</html>